<template>
	<view class="content">
		<view class="wrap">
			<view class="gz dis-flex flex-x-between flex-y-center" @click="toJump('/pages/my/changeBind')">
				<view class="txts flex-box">手机号</view>
				<view class="mr_10">{{ formatMobile(user.mobile) }}</view>
				<u-icon name="arrow-right" color="#252525" size="18"></u-icon>
			</view>

			<view class="gz dis-flex flex-x-between flex-y-center" @click="toJump('/pages/login/authentication')">
				<view class="txts flex-box">实名认证</view>
				<view class="mr_10" v-if="user.name">已认证</view>
				<view class="mr_10" v-else>未认证</view>
				<u-icon name="arrow-right" color="#252525" size="18"></u-icon>
			</view>
		</view>

		<view class="wrap">
			<view class="gz dis-flex flex-x-between flex-y-center">
				<view class="txts flex-box">微信账号</view>
				<view class="mr_10">未绑定</view>
				<u-icon name="arrow-right" color="#252525" size="18"></u-icon>
			</view>

			<view class="gz dis-flex flex-x-between flex-y-center">
				<view class="txts flex-box">QQ账号</view>
				<view class="mr_10">未绑定</view>
				<u-icon name="arrow-right" color="#252525" size="18"></u-icon>
			</view>

		</view>

		<!-- <view class="wrap">
			<view class="gz">
				<view class="txts tac quit">注销账号</view>
			</view>
		</view> -->
	</view>
</template>

<script>
import {
	getUserInfo,
} from "../../api/login.js";
export default {
	data() {
		return {
			value: '',
			user: {}
		}
	},
	onLoad(query) {

	},
	onShow() {
		this.getData()
	},
	mounted() {

	},
	methods: {
		formatMobile(mobile) {
			if (!mobile || mobile.length <= 4) {
				return mobile;
			} else {
				return mobile.substring(0, 3) + '****' + mobile.substring(mobile.length - 4);
			}
		},
		toJump(url) {
			if (!url) return
			uni.navigateTo({
				url
			});
		},
		async getData() {
			let res = await getUserInfo()
			console.log(res, '获取当前用户');
			this.user = res.data
		}
	}
}
</script>
<style lang="scss">
page {
	background-color: #f6f6f6;
}
</style>
<style lang="scss" scoped>
.content {
	padding: 0rpx 30rpx;

	.wrap {
		background: #FFFFFF;
		border-radius: 30rpx;

		.gz {
			padding: 30rpx;
			margin-top: 25rpx;

			.txts {
				font-weight: bold;
				font-size: 30rpx;
				color: $uni-text-color;
			}

			.quit {
				color: $uni-text-color-placeholder;
			}




		}
	}
}
</style>